package com.wlgc.controller;

import com.wlgc.entity.RestBean;
import com.wlgc.service.ClassService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/class")
@Slf4j
@PreAuthorize("hasAuthority('index')")
public class ClassController {

    @Autowired
    private ClassService classService;

    @GetMapping("/cno")
    public RestBean<List> getAllCno(){
        List<String> cno = classService.getAllCno();
        return RestBean.success(cno);
    }

}
